﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Arms : MonoBehaviour
{
    private Monster monster;
    private void Start()
    {
        monster = transform.parent.GetComponent<Monster>();
    }


    private void OnTriggerEnter2D(Collider2D collider2D)
    {
        if (collider2D.tag == GameObjectTags.playerTag)
        {
            DamageInfo damageInfo = new DamageInfo();
            damageInfo.damage = (int)Random.Range(monster.attack, monster.attack * 2);
            damageInfo.type = DamageType.Normal;
            collider2D.GetComponent<ICanTakeDamage>().TakeDamage(damageInfo, gameObject, false);
        }
    }
}
